<template>
  <div class="apply-card" @click="onView">
    <div class="status-box">
      <div class="status" :class="{ over: info.webDealerIsCompleted == 1 }">{{ info.webDealerIsCompleted == 1 ? '已录入' : '未录入' }}</div>
      <img class="close-icon" src="/@/assets/images/close.png" alt="" @click="onClose" />
    </div>
    <div class="t">
      <div>
        <img class="name-icon" src="/@/assets/images/user-blue.png" alt="" />
        保证人姓名
      </div>
      <span>{{ info.custName }}</span>
    </div>
    <div class="content">
      <div class="tag">抵押担保</div>
      <div class="item">
        <div class="label">
          <img class="item-icon" src="/@/assets/images/documents.png" alt="" />
          身份证号:
        </div>
        <div class="val">{{ info.certNo }}</div>
      </div>
      <div class="item">
        <div class="label">
          <img class="item-icon" src="/@/assets/images/oclock.png" alt="" />
          证件期效:
        </div>
        <div class="val">{{ info.certStartDate }}至{{ info.certEndDate }}</div>
      </div>
      <div class="item">
        <div class="label">
          <img class="item-icon" src="/@/assets/images/tel.png" alt="" />
          联系电话:
        </div>
        <div class="val">{{ info.custMobile }}</div>
      </div>
      <div class="item">
        <div class="label">国籍:</div>
        <div class="val">{{ info.custHomeplaceValue }}</div>
      </div>
      <div class="item">
        <div class="label">户籍省份:</div>
        <div class="val">{{ info.custAddressValue }}</div>
      </div>
    </div>
    <span class="btn">
      <img src="/@/assets/images/views.png" alt="" />
    </span>
  </div>
</template>

<script setup>
  import { ref, watch, onMounted } from 'vue';
  const emit = defineEmits(['close', 'view']);
  const props = defineProps({
    type: {
      type: String,
      default: 'wait',
    },
    info: {
      type: Object,
      default: () => {},
    },
  });
  const onClose = () => {
    emit('close');
  };
  const onView = () => {
    emit('view');
  };
</script>
<style scoped lang="less">
  .apply-card {
    width: calc(25% - 30rem);
    height: auto;
    padding: 50rem 20rem 44rem;
    background-color: #fff;
    box-shadow: 0rem 0rem 15rem 0rem rgba(0, 0, 0, 0.1);
    border-radius: 12rem;
    position: relative;
    .status-box {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-bottom: 16rem;
      position: absolute;
      left: 0;
      top: 0;
      .status {
        background: #fe8271;
        border-radius: 12rem 0 12rem 0;
        padding: 8rem 10rem;
        color: #fff;
        font-size: 12rem;
      }
      .close-icon {
        width: 20rem;
        height: 20rem;
        cursor: pointer;
        margin-right: 20rem;
      }
    }

    .t {
      font-family: Microsoft YaHei;
      font-weight: 400;
      font-size: 18rem;
      color: #0062ea;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1rem solid #e5e5e5;
      padding-bottom: 15rem;
      .name-icon {
        width: 17rem;
        height: 16rem;
        margin-right: 5rem;
      }
      span {
        font-family: Microsoft YaHei;
        font-weight: 400;
        font-size: 18rem;
        color: #000000;
      }
    }
    .f {
      display: flex;
      margin-top: 15rem;

      .time {
        font-family: Microsoft YaHei;
        font-weight: 400;
        font-size: 16rem;
        color: #a5a5a5;
      }
    }
    .btn {
      width: 137rem;
      height: 42rem;
      font-family: Microsoft YaHei;
      font-weight: 400;
      font-size: 16rem;
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      position: absolute;
      right: 24rem;
      bottom: 12rem;
      cursor: pointer;

      img {
        width: 23rem;
        height: 23rem;
        margin-left: 17rem;
      }
    }
    .content {
      position: relative;
      .tag {
        background: #f29e6a;
        font-family: SimSun;
        font-size: 12px;
        color: #ffffff;
        padding: 6rem 10rem;
        position: absolute;
        right: 0;
        top: 14rem;
      }
      .item {
        padding: 20rem 0 0;
        display: flex;
        align-items: center;

        .label {
          width: 109rem;
          font-family: Microsoft YaHei;
          font-weight: 400;
          font-size: 16rem;
          color: #a5a5a5;
          display: flex;
          align-items: center;
          justify-content: end;
          margin-right: 20rem;
          .item-icon {
            width: 17rem;
            height: 14rem;
            margin-right: 16rem;
          }
        }
        .val {
          flex: 1;
          font-family: Microsoft YaHei;
          font-weight: 400;
          font-size: 16rem;
          color: #3b3b3b;
        }
      }
    }
  }
</style>
